
const HOME_INIT = "HOME_INIT", WAVE_DATA = "WAVE_DATA"

let initStates = {
  name: 'demo2',
  classList: [],
  wave: []
};

function home(state = initStates, action) {
  switch (action.type) {
    case 'CHANGE_NAME':
      return Object.assign({}, state, {
        name: action.data
      });
    case HOME_INIT:
      return Object.assign({}, state, {
        classList: action.data
      });

    case WAVE_DATA:
      return Object.assign({}, state, {
        wave: [
          ...action.data
        ]
      });
    default:
      return state;
  };
};


export default home;
